package cn.com.blueInfo.bpm.template.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.template.entity.NodeDecision;
import cn.com.blueInfo.bpm.template.request.NodeDecisionDTO;
import cn.com.blueInfo.bpm.template.response.NodeDecisionVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 节点流转规则表 对象转换
 * @author suxch
 * @since 2025-08-31 16:23:18
 */
@Mapper(componentModel = "spring")
public interface NodeDecisionConvert
        extends BaseConvert<NodeDecision, NodeDecisionDTO, NodeDecisionVO> {

    NodeDecision dtoToEntity(NodeDecisionDTO dto);

    NodeDecision dtoToEntity(NodeDecisionDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "decisionType", target = "decisionType", qualifiedByName = "enumToDesc")
    NodeDecisionVO entityToVO(NodeDecision entity);

}